<template>
  <div class="container">
    <!-- <h1 class="animate__animated animate__rollIn" >{{comment}}</h1> -->
    <h1 class="animate__animated animate__rollIn">
      该页面将用于记录，课堂纪律情况并开通学生监督功能。学生违纪且不听劝阻，拒绝管理者将被记录。
      例如武松违反纪律，将被记录为“武某于2021/5/8违反了课堂携带电子设备课堂纪律经劝阻和管理无效后予以记录。”
    </h1>
    <div>
      <el-table :data="record" style="width: 100%">
        <el-table-column type="index" :index="indexMethod"> </el-table-column>
        <el-table-column prop="student_" label="学生" width="160">
        </el-table-column>
        <el-table-column prop="issue" label="问题" width="460">
        </el-table-column>
        <el-table-column prop="time" label="时间" width="100">
        </el-table-column>
        <el-table-column prop="deal" label="已处理" width="100">
        </el-table-column>
        <el-table-column width="100">
          <!-- <template #default="scope">
              <a :href="'/api/file/' + scope.row.fl">下载</a>
            </template> -->
        </el-table-column>
        <el-table-column label="学生监督" width="150">
          <template #default="scope">
            <!-- <el-button @click="download(scope.row)" type="text" size="small"
                >下载</el-button
              > -->
            <!-- <a :href="'/rewa/?ip=' + scope.row.student">向班主任反馈</a> -->
            <el-button @click="sendfeed(scope.row)">向班主任反馈</el-button>
            <!-- <el-button type="text" size="small">编辑</el-button> -->
          </template>
        </el-table-column>
      </el-table>
    </div>

    
  </div>
</template>

<script>
import axios from "axios";

export default {
  data() {
    return {
      rewardf: false,
      record: [],
    };
  },
  created() {
    axios.get("/api/listrecord").then((res) => {
      console.log(res.data, 222);
      this.record = res.data;
    });
  },
  computed: {
    src() {
      return (
        "http://192.168.1.254:8080/api/material/games/" +
        this.gamec +
        "/index.html"
      );
    },
  },
  methods: {
    sendfeed(e) {
      if(e.deal=='是'){
        alert('已解决的问题，不可报告！')
        return
      }
      let ques =
        "学生\n" + e.student + "违纪描述\n" + e.issue + "发生时间\n" + e.time;
     let fla =  confirm("确认反馈\n" + ques);
     console.log(fla)
    if (fla){ 
      axios.get("/api/sendfeedback/" + ques);
    }
    },
  },
};
</script>

<style>
.container {
  flex-direction: column;
  height: 100vh;
  display: flex;
  align-items: center;
  /* justify-items: center; */
  /* justify-content: center; */
}
.ifw {
  width: 100vw;
  height: 70vh;
}
iframe {
  width: 100%;
  height: 100%;
}
</style>
